package org.jivesoftware.smack.util.dns;

public class SRVRecord extends HostAddress
  implements Comparable<SRVRecord>
{
  private int weight;
  private int priority;

  public SRVRecord(String paramString, int paramInt1, int paramInt2, int paramInt3)
  {
    super(paramString, paramInt1);
    if ((paramInt3 < 0) || (paramInt3 > 65535))
      throw new IllegalArgumentException("DNS SRV records weight must be a 16-bit unsiged integer (i.e. between 0-65535. Weight was: " + paramInt3);
    if ((paramInt2 < 0) || (paramInt2 > 65535))
      throw new IllegalArgumentException("DNS SRV records priority must be a 16-bit unsiged integer (i.e. between 0-65535. Priority was: " + paramInt2);
    this.priority = paramInt2;
    this.weight = paramInt3;
  }

  public int getPriority()
  {
    return this.priority;
  }

  public int getWeight()
  {
    return this.weight;
  }

  public int compareTo(SRVRecord paramSRVRecord)
  {
    int i = paramSRVRecord.priority - this.priority;
    if (i == 0)
      i = this.weight - paramSRVRecord.weight;
    return i;
  }

  public String toString()
  {
    return super.toString() + " prio:" + this.priority + ":w:" + this.weight;
  }
}

/* Location:           D:\hygieia\userclient\common\libs\easemobchat_2.1.8.jar
 * Qualified Name:     org.jivesoftware.smack.util.dns.SRVRecord
 * JD-Core Version:    0.6.1
 */